package com.bungarus.rm.service;

import com.bungarus.rm.model.IDMakerScope;
import com.bungarus.rm.model.UniqueNodeID;

import java.util.Optional;

/**
 * Created by tang on 2019/1/13.
 */
public interface MsgIDScopeService {
    Optional<IDMakerScope> requestAScope(UniqueNodeID id);

    default Optional<IDMakerScope> requestAScope(int clusterId, int nodeId) {
        return requestAScope(new UniqueNodeID(clusterId, nodeId));
    }

    Optional<IDMakerScope> releaseAScope(UniqueNodeID id);

    default Optional<IDMakerScope> releaseAScope(int clusterId, int nodeId) {
        return releaseAScope(new UniqueNodeID(clusterId, nodeId));
    }
}
